requirejs.config({
    baseUrl: 'js',
    paths: {
        zepto : 'zepto.min',   //轻量级仿JQ类库，适合在移动web中使用
        swipe : 'swipe',
        echo  : 'echo.min'
    },
    zepto: {
        exports: '$'
    },
    // shim: {
    //     'swipe': {deps:['zepto']},
    // }
});
require(['zepto','swipe'],function(){

    common.openClassSucceed()

    //轮播图
    var elemslider = document.querySelector('#slider');
    var elembtns = elemslider.getElementsByTagName("li");
    var num = 0;
    window.mySwipe = new Swipe(elemslider, {
        startSlide: 0,
        speed: 400,
        auto: 3000,
        continuous: true,
        disableScroll: false,
        stopPropagation: false,
        callback: function(index, elem) {
            elembtns[num].className = "";
            num = index;
            elembtns[index].className = "active";
        },
        transitionEnd: function(index, elem) {}
    });
    //轮播图
    echo.init({
        offset: 0,
        throttle: 0
    });
    console.log($('window'))
    $('window').on('scroll',function(){
        console.log('d')
    })

    var seminary = $("#seminary"),sidemenu_filter_dialog = $("#sidemenu-filter-dialog"),isopen = false;
    seminary.on('click',function(){
        if(isopen && $(this).hasClass('open')){
            isopen = false;
            $(this).removeClass('open')
            sidemenu_filter_dialog.removeClass('overlapping')
        }else{
            isopen = true;
            $(this).addClass('open')
            sidemenu_filter_dialog.addClass('overlapping')
        }
    })
    //列表上的按钮添加事件
    //course-type:1公开课、2收费班课
    $(".product_lists").on('click','.weui-btn',function(){
        console.log($(this).data('course-type'))
    })
});